<template>
  <div class="SystemManage">
    <div class="left">
      <div class="menus">
        <el-tree :data="data" :props="defaultProps" highlight-current default-expand-all @node-click="handleNodeClick"></el-tree>
<!--        <ul>-->
<!--          <li><router-link to="/firstPage">首页管理</router-link></li>-->
<!--          <li><router-link to="/paperManage">文章管理</router-link></li>-->
<!--          <li><router-link to="/MemberManage">人员管理</router-link></li>-->
<!--        </ul>-->
      </div>
    </div>
    <div class="page">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        data: [{
          label: '系统设置',
          children: [
            {
              label: '首页管理',
            },
            {
              label: '文章管理',
            },
            {
              label: '人员管理',
            }
          ]
        }],
        defaultProps: {
          children: 'children',
          label: 'label'
        }
      }
    },
    created() {
    },
    methods: {
      handleNodeClick(page){
        if(page.label === '首页管理'){
          this.$router.push('/SystemManage')
        } else if (page.label === '文章管理'){
          this.$router.push({name: 'paperManage'})
        } else if(page.label === '人员管理'){
          this.$router.push({name: 'MemberManage'})
        }
    }
    },
    computed: {},
    components: {}
  }
</script>

<style lang="scss" scoped>
  .SystemManage{
    display: flex;
    font-size: 22px;
    padding: 20px 0;
    .left{
      width: 150px;
      border-right: 1px solid #ccc;
      line-height: 30px;
      height: 100vh;
      .menus{
        /deep/ .el-tree-node__label{
          font-size: 16px;
        }
      }
    }
    .page{
      flex: 1;
    }
  }
</style>
